package com.zystudio.func.interf;

import android.view.View;

public abstract class SingleClickListener implements View.OnClickListener {

    //快速点击间隔时间
    private static final int INTERVAL_TIME = 1000;
    private long lastClickTime = 0L;


    @Override
    public void onClick(View v) {
        long clickTime = System.currentTimeMillis();
        if (clickTime - lastClickTime < INTERVAL_TIME) {
            return;
        }
        lastClickTime = clickTime;
        onSingleClick(v);
    }

    public abstract void onSingleClick(View v);
}
